package com.hjj.springboot.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

/**
 * 商品小类
 */
@TableName("t_smallType")
@Data
public class SmallType implements Serializable {

    @ExcelProperty("商品小类编号")
    @ColumnWidth(20)
    private Integer id; // 编号

    @ExcelProperty("商品小类名称")
    @ColumnWidth(30)
    private String name; // 名称

    @ExcelProperty("商品小类备注")
    @ColumnWidth(30)
    private String remark; // 备注

    @ExcelProperty("所属大类编号")
    private Integer bigTypeId; // 大类id

    @ExcelIgnore
    @TableField(select = false,insertStrategy = FieldStrategy.NEVER,updateStrategy = FieldStrategy.NEVER)
    private BigType bigType;  // 所属商品大类

    @ExcelIgnore
    @TableField(select = false)
    private List<Product> productList; // 商品集合

}

